export const drawer_config = () => {
    const config = {
        show: false,
        title: "岗位",
        direction: "rtl",
        size: "30%",
        labelWidth: "90px",
        messageBox: {
            status: true,
            title: "提示",
            message: "是否保存当前数据？",
            confirmButtonText: '保存',
            cancelButtonText: '放弃',
            type: 'warning', // success
            confirmEventName: "save",
            cancelEventName: null
        },
        ifSave: true,
        form: [
            {
                key: "roleId",
                type: "hidden",
            },
            {
                key: "menuIds",
                type: "hidden",
            },
            {
                key: "deptIds",
                type: "hidden",
            },
            {key: "roleName", type: "text", label: "角色名称", alert: ""},
            {key: "roleKey", type: "text", label: "角色编码", alert: ""},
            {key: "roleSort", type: "number", label: "显示排序", min: 0, max: 999, alert: ""},
            {
                key: "status",
                type: "radio",
                label: "显示状态",
                source: "dict", //source: dict字典查询/select 数据来源方向
                dict: "sys_normal_disable"
            },
            {key: "remark", type: "textarea", label: "备注", alert: ""},
            {
                key: "menuIds",
                type: "tree",
                label: "菜单权限",
                options: [],
                props: {value: "id", label: "label"}
            }
        ],
        //https://github.com/yiminghe/async-validator
        rules: {
            roleName: [
                {required: true, message: '请输入角色名称', trigger: 'blur'},
                {min: 2, max: 9, message: '长度需要2-9个汉字', trigger: 'blur'},
            ],
            roleKey: [
                {required: true, message: '请输入角色编码', trigger: 'blur'},
            ],
            roleSort: [
                {required: true, message: '请输入排序', trigger: 'blur'},
            ]
        }
    }
    return config
}